package com.ims.core.doc.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ims.common.annotation.Log;
import com.ims.common.core.controller.BaseController;
import com.ims.common.core.domain.AjaxResult;
import com.ims.common.enums.BusinessType;
import com.ims.core.doc.domain.TInNon1009;
import com.ims.core.doc.service.ITInNon1009Service;
import com.ims.common.utils.poi.ExcelUtil;
import com.ims.common.core.page.TableDataInfo;

/**
 * 1009 区块链电子发票Controller
 *
 * @author IMS
 * @date 2024-12-01
 */
@RestController
@RequestMapping("/doc/qukuailian")
public class TInNon1009Controller extends BaseController
{
    @Autowired
    private ITInNon1009Service tInNon1009Service;

    /**
     * 查询1009 区块链电子发票列表
     */
    @PreAuthorize("@ss.hasPermi('doc:qukuailian:list')")
    @GetMapping("/list")
    public TableDataInfo list(TInNon1009 tInNon1009)
    {
        startPage();
        List<TInNon1009> list = tInNon1009Service.selectTInNon1009List(tInNon1009);
        return getDataTable(list);
    }

    /**
     * 导出1009 区块链电子发票列表
     */
    @PreAuthorize("@ss.hasPermi('doc:qukuailian:export')")
    @Log(title = "1009 区块链电子发票", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, TInNon1009 tInNon1009)
    {
        List<TInNon1009> list = tInNon1009Service.selectTInNon1009List(tInNon1009);
        ExcelUtil<TInNon1009> util = new ExcelUtil<TInNon1009>(TInNon1009.class);
        util.exportExcel(response, list, "1009 区块链电子发票数据");
    }

    /**
     * 获取1009 区块链电子发票详细信息
     */
    @PreAuthorize("@ss.hasPermi('doc:qukuailian:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(tInNon1009Service.selectTInNon1009ById(id));
    }

    /**
     * 新增1009 区块链电子发票
     */
    @PreAuthorize("@ss.hasPermi('doc:qukuailian:add')")
    @Log(title = "1009 区块链电子发票", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TInNon1009 tInNon1009)
    {
        return toAjax(tInNon1009Service.insertTInNon1009(tInNon1009));
    }

    /**
     * 修改1009 区块链电子发票
     */
    @PreAuthorize("@ss.hasPermi('doc:qukuailian:edit')")
    @Log(title = "1009 区块链电子发票", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TInNon1009 tInNon1009)
    {
        return toAjax(tInNon1009Service.updateTInNon1009(tInNon1009));
    }

    /**
     * 删除1009 区块链电子发票
     */
    @PreAuthorize("@ss.hasPermi('doc:qukuailian:remove')")
    @Log(title = "1009 区块链电子发票", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(tInNon1009Service.deleteTInNon1009ByIds(ids));
    }
}
